﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfService
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的类名“Service1”。
    public class Service1 : IService1
    {
        IBLL.IBLLSession bl = DI.SpringHelper.GetObject<IBLL.IBLLSession>("BLLSession");

        //ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client();
        //public string UserLogin(string Acc, string Pwd, string YZM, int RETID)
        //{
        //    return sc.UserLogin(Acc, Pwd, YZM, RETID);
        //}

        //public string OperUserLogin(string Acc, string Pwd, string YZM, int RETID)
        //{
        //    return sc.OperUserLogin(Acc, Pwd, YZM, RETID);
        //}

        #region  SetOrder_Shel更新上架信息
        public string SetOrder_Shel(string DishesID, int HasNub, string YZM, int RETID)
        {
            return bl.IOrder_Shelves_TBLL.SetOrder_Shel(DishesID, HasNub, YZM, RETID);
        }
        #endregion



        #region GetDayReport_table获取商户分类日结信息
        public string GetDishesType_table(string MerID, string TimeS, string TimeE, string YZM, int RETID)
        {
            return bl.IOrder_DayReport_Mer_TBLL.GetDishesType_table(MerID, TimeS, TimeE, YZM, RETID);
        }
        #endregion

        #region GetDayReport_Dishes 获取商户日结信息
        public string GetDayReport_Dishes(string MerID, string Uer, string TimeS, string TimeE, string YZM, int RETID)
        {
            return bl.IOrder_DayReport_Mer_TBLL.GetDayReport_Dishes(MerID, Uer, TimeS, TimeE, YZM, RETID);
        }
        #endregion

        #region  GetOrder_FlowInt查询积分流水信息
        public string GetOrder_FlowInt(int pageIndex, int pageSize, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_FlowInt_TBLL.GetOrder_FlowInt(pageIndex, pageSize, MerID, YZM, RETID);
        }
        #endregion

        #region GetOrder_FlowMon 查询金额流水

        #endregion

        #region  GetOrder_ FlowPay查询第三方支付流水
        public string GetOrder_FlowPay(int pageIndex, int pageSize, string YZM, int RETID)
        {
            return bl.IOrder_FlowPay_TBLL.GetOrder_FlowPay(pageIndex, pageSize, YZM, RETID);
        }
        #endregion

        //模糊查询第三方支付流水


        #region GetOrder_Int查询商户积分管理信息
        public string GetOrder_Int(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Int_TBLL.GetOrder_Int(MerID, YZM, RETID);
        }
        #endregion
        #region GetOrder_Int查询用户积分信息
        public string GetOrder_UserInt_T(int pageIndex, int pageSize, int AccID, string YZM, int RETID)
        {
            return bl.IOrder_UserInt_TBLL.GetOrder_UserInt_T(pageIndex, pageSize, AccID, YZM, RETID);
        }
        #endregion

        #region GetOrder_MerInt查询商户积分管理信息
        public string GetOrder_MerInt(int OperID, string YZM, int RETID)
        {
            return bl.IOrder_Int_TBLL.GetOrder_MerInt(OperID, YZM, RETID);
        }
        #endregion

        #region Order_Mer
        public string GetShelvesInfo(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetShelvesInfo(MerID, YZM, RETID);
        }
        public string GetOrder_Mer(string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetOrder_Mer(YZM, RETID);
        }
        public string GetShopList(int pageIndex, int pageSize, string KeyWord, string FenLei, int PaiXu, int DelMaxMon, int DelFormMon, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetShopList(pageIndex, pageSize, KeyWord, FenLei, PaiXu, DelMaxMon, DelFormMon, YZM, RETID);
        }

        public string GetShopInfo(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetShopInfo(MerID, YZM, RETID);
        }
        public string GetOrder_MerByOperId(int OperID, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetOrder_MerByOperId(OperID, YZM, RETID);
        }
        #region  SetOrder_Mer更新商户信息信息
        public string SetOrder_Mer(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.SetOrder_Mer(OperID, json, tag, YZM, RETID);
        }
        #endregion
        public string SetMerPhoto(string MerID, string PhotoAdd, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.SetMerPhoto(MerID, PhotoAdd, YZM, RETID);
        }
        public byte[] GetMerPhoto(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.GetPhoto(MerID, YZM, RETID);
        }

        public string UpdateMerPhoto(string MerID, byte[] Pic, string YZM, int RETID)
        {
            return bl.IOrder_Mer_TBLL.UpdateMerPhoto(MerID, Pic, YZM, RETID);
        }
        #endregion

        #region GetOrder_MerAccount查询商户账目
        public string GetOrder_MerAccount(int pageIndex, int pageSize, string MerID, string MerAccType, string MerAccDate, string YZM, int RETID)
        {
            return bl.IOrder_MerAccount_TBLL.GetOrder_MerAccount(pageIndex, pageSize, MerID, MerAccType, MerAccDate, YZM, RETID);
        }
        #endregion

        #region GetOrder_MerPricing所有商户的订单优惠信息
        public string GetOrder_MerPricing(int pageIndex, int pageSize, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_MerPricing_TBLL.GetOrder_MerPricing(pageIndex, pageSize, MerID, YZM, RETID);
        }
        #endregion

        #region GetOrder_UserInt查询用户积分信息
        public string GetOrder_UserInt(int pageIndex, int pageSize, string MerID, Dictionary<string, string> Dic, string YZM, int RETID)
        {
            return bl.IOrder_UserInt_TBLL.GetOrder_UserInt(pageIndex, pageSize, MerID, Dic, YZM, RETID);
        }
        #endregion

        #region GetOrder_UserWalt查询用户钱包信息
        public string GetOrder_UserWalt(int pageIndex, int pageSize, string AccName, string AccCall, string AccIdentifier, string AccCerNub, string YZM, int RETID)
        {
            return bl.IOrder_UserWalt_TBLL.GetOrder_UserWalt(pageIndex, pageSize, AccName, AccCall, AccIdentifier, AccCerNub, YZM, RETID);
        }
        public string GetUserPayWalt(int AccID, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Walt_TBLL.GetUserPayWalt(AccID, MerID, YZM, RETID);
        }
        public string GetUserWalt(int AccID, string YZM, int RETID)
        {
            return bl.IOrder_UserWalt_TBLL.GetUserWalt(AccID, YZM, RETID);
        }
        #endregion

        #region
        //找一个订单里有多少个优惠
        public string GetDiscounts(string MerID, string PayID, int PricType, string YZM, int RETID)
        {
            return bl.IOrder_MerPricing_TBLL.GetDiscounts(MerID, PayID, PricType, YZM, RETID);
        }

        //计算用户选择的优惠

        public string CalcDiscount(string[] DishIDs, int[] DistCount, string MerID, string PricID, int IsTake, string YZM, int RETID)
        {
            return bl.IOrder_MerPricing_TBLL.CalcDiscount(DishIDs, DistCount, MerID, PricID, IsTake, YZM, RETID);
        }


        #endregion

        #region Order_Form_T

        public string ReBookOrder(int FormID, string PayID, int lx, int IsTake, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.ReBookOrder(FormID, PayID, lx, IsTake, YZM, RETID);
        }
        public string ReBookOrder2(int FormID, string PayID, int lx, int IsTake, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.ReBookOrder2(FormID, PayID, lx, IsTake, YZM, RETID);
        }
        public string GetNewOrderId(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetNewOrderId(FormID, YZM, RETID);
        }
        #region SetOrder_Form根据商户ID获取该商户的所有订单信息
        public string GetOrder_Form(int pageIndex, int pageSize, string StarTime, string EndTime, string FormBY, string MerID, string YZM, int RETID)
        {
            return bl.IView_Order_FormBLL.GetOrder_Form(pageIndex, pageSize, StarTime, EndTime, FormBY, MerID, YZM, RETID);
        }
        public string GetOrder_Form_User(int pageIndex, int pageSize, string OpenId, int type, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetOrder_Form_User(pageIndex, pageSize, OpenId, type, YZM, RETID);
        }
        public string BookOrder(string Data, string PayID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.BookOrder(Data, PayID, YZM, RETID);
        }
        public string BookOrder2(string Data, string PayID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.BookOrder2(Data, PayID, YZM, RETID);
        }
        public string updFormBY(int FormID, string Flowform, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.updFormBY(FormID, Flowform, YZM, RETID);
        }
        public string FeatchIspy(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.FeatchIspy(FormID, YZM, RETID);
        }
        public string UpdateFormIsPay(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.UpdateFormIsPay(FormID, YZM, RETID);
        }
        public string getOrderDetailByOrderID(int FormID, string YZM, int RETID)
        {
            return bl.IView_Order_FormBLL.getOrderDetailByOrderID(FormID, YZM, RETID);
        }
        public string GetOrder_OpenIDSendList(string OpenID, string FormID, string GetType, int DataIndex, int DataSize, string Sdate, string Edate, string ConID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetOrder_OpenIDSendList(OpenID, FormID, GetType, DataIndex, DataSize, Sdate, Edate, ConID, YZM, RETID);
        }
        #endregion

        #region 根据订单ID付款
        public string singlePay(int FormID, int FormPayType, string PayID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.singlePay(FormID, FormPayType, PayID, YZM, RETID);
        }
        #endregion

        #region SetOrder_Form修改商户的订单状态和备注信息
        public string SetOrder_Form(int OperID, int MerID, string FormID, string FormBY, string IntBZ, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.SetOrder_Form(OperID, MerID, FormID, FormBY, IntBZ, YZM, RETID);
        }
        #endregion

        public string CountDiscount(string[] DishIDs, int[] DistCount, string MerID, string PayID, int PricType, int IsTake, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.CountDiscount(DishIDs, DistCount, MerID, PayID, PricType, IsTake, YZM, RETID);
        }
        public string GetNewOrderIdByPS(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetNewOrderIdByPS(FormID, YZM, RETID);
        }
        public string GetDishesShoppingCar(string[] CarID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetDishesShoppingCar(CarID, YZM, RETID);
        }
        public string GetOrderTime(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetOrderTime(MerID, YZM, RETID);
        }

        public string CountPs(string MerId, string StatS, string BDate, string EDate, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.CountPs(MerId, StatS, BDate, EDate, YZM, RETID);
        }
        #endregion

        // 根所订单号查询订单详情
        public string GetFormByID(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.GetFormByID(FormID, YZM, RETID);
        }

        #region GetOrder_FormControl查询订单状态控制表
        public string GetOrder_FormControl(string YZM, int RETID)
        {
            return bl.IOrder_FormControl_TBLL.GetOrder_FormControl(YZM, RETID);
        }
        #endregion

        #region 返回订单大于等于当前状态的ConID集合
        public string GetFromConID(int FormID, string Componen, int tag, string YZM, int RETID)
        {
            return bl.IOrder_FormControl_TBLL.GetFromConID(FormID, Componen, tag, YZM, RETID);
        }
        #endregion


        #region Order_Eva
        #region GetOrder_Eva所有商户的评价管理信息
        public string GetOrder_Eva(int pageIndex, int pageSize, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Eva_TBLL.GetOrder_Eva(pageIndex, pageSize, MerID, YZM, RETID);
        }
        #endregion




        public string GetDIshEva(string DishesID, string YZM, int RETID)
        {
            return bl.IOrder_Eva_TBLL.GetDIshEva(DishesID, YZM, RETID);
        }
        public string SetOrder_Eva(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Eva_TBLL.SetOrder_Eva(OperID, json, tag, YZM, RETID);
        }

        public string AddOrderEva(string FormID, string[] FormDishesID, string EvaTxt, int EvaStars, string YZM, int RETID)
        {
            return bl.IOrder_Eva_TBLL.AddOrderEva(FormID, FormDishesID, EvaTxt, EvaStars, YZM, RETID);
        }
        #endregion

        #region SetOrder_Int更新商户积分管理信息
        public string SetOrder_Int(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Int_TBLL.SetOrder_Int(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region SetOrder_UserInt更新用户积分信息
        public string SetOrder_UserInt(int OperID, int UserIntID, string Tag, string OrderID, int updateInt, string BZ, string YZM, int RETID)
        {
            return bl.IOrder_UserInt_TBLL.SetOrder_UserInt(OperID, UserIntID, Tag, OrderID, updateInt, BZ, YZM, RETID);
        }
        #endregion

        #region  SetOrder_UserWalt更新用户钱包信息
        public string SetOrder_UserWalt(int OperID, int UserWaltID, int Tag, string OrderID, int updateMoney, string BZ, string YZM, int RETID)
        {
            return bl.IOrder_UserWalt_TBLL.SetOrder_UserWalt(OperID, UserWaltID, Tag, OrderID, updateMoney, BZ, YZM, RETID);
        }
        #endregion

        #region GetOrder_Key查询系统参数设置查询接口
        public string GetOrder_Key(string YZM, int RETID)
        {
            return bl.IOrder_Key_TBLL.GetOrder_Key(YZM, RETID);
        }
        #endregion

        #region SetOrder_Key更新系统参数设置接口（只有修改功能）
        public string SetOrder_Key(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Key_TBLL.SetOrder_Key(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region GetOrder_Pay查询第三方支付管理接口
        public string GetOrder_Pay(string YZM, int RETID)
        {
            return bl.IOrder_Pay_TBLL.GetOrder_Pay(YZM, RETID);
        }
        #endregion

        #region SetOrder_Pay_Key更新第三方支付管理接口
        public string SetOrder_Pay_Key(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Pay_TBLL.SetOrder_Pay_Key(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region GetOrder_Walt查询钱包信息
        public string GetOrder_Walt(string YZM, int RETID)
        {
            return bl.IOrder_Walt_TBLL.GetOrder_Walt(YZM, RETID);
        }
        #endregion

        #region SetOrder_Walt更新钱包信息（删除时当有用户使用钱包，该钱包不允许删除）
        public string SetOrder_Walt(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Walt_TBLL.SetOrder_Walt(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region GetOrder_OperationFlow查询系统操作流水表信息
        public string GetOrder_OperationFlow(int pageIndex, int pageSize, string Time_Start, string Time_End, string LogType, string Operat_Result, string YZM, int RETID)
        {
            return bl.IView_Order_OperationFlowInfoBLL.GetOrder_OperationFlow(pageIndex, pageSize, Time_Start, Time_End, LogType, Operat_Result, YZM, RETID);
        }
        #endregion

        #region GetMer根据操作员权限获取对应商户权限
        public string GetMer(int OperID, string YZM, int RETID)
        {
            return bl.IOrder_Oper_TBLL.GetMer(OperID, YZM, RETID);
        }
        #endregion

        #region SetMerOperID设置操作员的商户权限
        public string SetMerOperID(int OperID, string json, string YZM, int RETID)
        {
            return bl.IOrder_Oper_TBLL.SetMerOperID(OperID, json, YZM, RETID);
        }
        #endregion

        #region Order_Dishes
        public string SetOrder_Dishes(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.SetOrder_Dishes(OperID, json, tag, YZM, RETID);
        }
        #region GetOrder_Dishes根据商户获取该商户所有的商品信息
        public string GetOrder_Dishes(string MerID, string YZM, int RETID)
        {
            return bl.IView_Order_DishesBLL.GetOrder_Dishes(MerID, YZM, RETID);
        }
        #endregion
        public string SetDishPhoto(string DishesID, string PhotoAdd, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.SetDishPhoto(DishesID, PhotoAdd, YZM, RETID);
        }

        public byte[] GetPhoto(string DishesID, int Lx, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.GetPhoto(DishesID, Lx, YZM, RETID);
        }

        public string UpdatePhoto(string DishesID, byte[] Pic, byte[] PicSmall, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.UpdatePhoto(DishesID, Pic, PicSmall, YZM, RETID);
        }

        public string UpdateDishesPhoto(string DishesID, string DishesURL, string DishesDaURL, string DishesXiaoURL, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.UpdateDishesPhoto(DishesID, DishesURL, DishesDaURL, DishesXiaoURL, YZM, RETID);
        }

        public string Get_Order_Dishes(string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.Get_Order_Dishes(YZM, RETID);
        }

        public string GetOrder_DishesByDY(string DishesTypeID, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.GetOrder_DishesByDY(DishesTypeID, YZM, RETID);
        }

        public string UpdateOrder_Dishes_Up(int OperID, string json, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.UpdateOrder_Dishes_Up(OperID, json, RETID);
        }

        public string UpdateOrder_Dishes_Down(int OperID, string json, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.UpdateOrder_Dishes_Down(OperID, json, RETID);
        }

        public string UpdateOrder_Dishes_Del(int OperID, string json, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.UpdateOrder_Dishes_Del(OperID, json, RETID);
        }

        public string Get_Order_DishesList(string DishesTypeID, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.Get_Order_DishesList(DishesTypeID, YZM, RETID);
        }

        public string Get_Order_DishesByDishesID(string DishesID, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.Get_Order_DishesByDishesID(DishesID, YZM, RETID);
        }

        public string GetDishesList(string DishesNmae, int PaiXu, string DishesTypeID1, string DishesTypeID2, string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.GetDishesList(DishesNmae, PaiXu, DishesTypeID1, DishesTypeID2, YZM, RETID);
        }

        public string GetDishesGoods(string YZM, int RETID)
        {
            return bl.IOrder_Dishes_TBLL.GetDishesGoods(YZM, RETID);
        }

        #endregion

        #region GetOrder_DishesType获取商品分类信息
        public string GetOrder_DishesType(string MerID, string YZM, int RETID)
        {
            return bl.IView_Order_DishesTypeBLL.GetOrder_DishesType(MerID, YZM, RETID);
        }
        #endregion

        #region SetOrder_DishesType更新商品分类信息（删除商品分类时要注意把对应商品的商品分类绑定去掉）
        public string SetOrder_DishesType(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.SetOrder_DishesType(OperID, json, tag, YZM, RETID);
        }

        public string SetOrder_DishesType2(int OperID, string json, int tag, string PantID, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.SetOrder_DishesType2(OperID, json, tag, PantID, YZM, RETID);
        }
        #endregion

        #region GetOrder_Shelves根据商户ID获取该商户的所有上架信息
        public string GetOrder_Shelves(int pageIndex, int pageSize, string MerID, string YZM, int RETID)
        {
            return bl.IView_Order_ShelvesBLL.GetOrder_Shelves(pageIndex, pageSize, MerID, YZM, RETID);
        }
        #endregion

        #region SetOrder_Shelves更新商户的所有上架信息
        public string SetOrder_Shelves(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Shelves_TBLL.SetOrder_Shelves(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region SetOrder_MerPricing更新商户的所有上架信息
        public string SetOrder_MerPricing(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_MerPricing_TBLL.SetOrder_MerPricing(OperID, json, tag, YZM, RETID);
        }
        #endregion

        #region GetOrder_PayType根据支付模式查询对应的支付信息
        public string GetOrder_PayType(int PricType, string YZM, int RETID)
        {
            return bl.IOrder_MerPricing_TBLL.GetOrder_PayType(PricType, YZM, RETID);
        }
        #endregion

        #region Order_MerSetWxMess_T

        public string GetMerWxID(string MerID, string YZM, int RETID)
        {
            return bl.IOrder_MerSetWxMess_TBLL.GetMerWxID(MerID, YZM, RETID);
        }

        public string UpdateMerWxID(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_MerSetWxMess_TBLL.UpdateMerWxID(json, tag, YZM, RETID);
        }

        public string Set_MerWxID(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_MerSetWxMess_TBLL.Set_MerWxID(json, tag, YZM, RETID);
        }
        #endregion

        #region 企业帐号接口
        #region Order_FlowOrganization_T

        /// <summary>
        /// 根据商户ID拿到商户的流水
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="MerID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrgFlowListFromMer(int pageIndex, int pageSize, string MerID, string StarTime, string EndTime, int Flat, string YZM, int RETID)
        {
            return bl.IOrder_FlowOrganization_TBLL.GetOrgListFromMer(pageIndex, pageSize, MerID, StarTime, EndTime, Flat, YZM, RETID);
        }


        /// <summary>
        /// 根据企业ID拿到商户的流水
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="OrgID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrgFlowListFromOrg(int pageIndex, int pageSize, int OrgID, string StarTime, string EndTime, int Flat, string YZM, int RETID)
        {
            return bl.IOrder_FlowOrganization_TBLL.GetOrgListFromOrg(pageIndex, pageSize, OrgID, StarTime, EndTime, Flat, YZM, RETID);
        }

        public string GetOrgFlowListFrom(int pageIndex, int pageSize, string MerID, int OrgID, string StarTime, string EndTime, int Flat, string YZM, int RETID)
        {
            return bl.IOrder_FlowOrganization_TBLL.GetOrgFlowListFrom(pageIndex, pageSize, MerID, OrgID, StarTime, EndTime, Flat, YZM, RETID);
        }
        #endregion

        #region Order_Organization_T
        /// <summary>
        /// 企业修改额度
        /// </summary>
        /// <param name="OperID"></param>
        /// <param name="OrgID"></param>
        /// <param name="OrgWaltLimit"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string SetOrganizationLimit(int OperID, int OrgID, int OrgWaltLimit, string YZM, int RETID)
        {
            return bl.IOrder_Organization_TBLL.SetOrganizationLimit(OperID, OrgID, OrgWaltLimit, YZM, RETID);
        }
        /// <summary>
        /// 企业登录
        /// </summary>
        /// <param name="OrgName"></param>
        /// <param name="Pwd"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string OrgLogin(string OrgName, string Pwd, string YZM, int RETID)
        {
            return bl.IOrder_Organization_TBLL.OrgLogin(OrgName, Pwd, YZM, RETID);
        }
        /// <summary>
        /// 根据商户ID拿到企业列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="MerID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrgListFromMer(int pageIndex, int pageSize, string MerID, Dictionary<string, string> Dic, string YZM, int RETID)
        {
            return bl.IOrder_Organization_TBLL.GetOrgListFromMer(pageIndex, pageSize, MerID, Dic, YZM, RETID);
        }
        /// <summary>
        /// 设置企业
        /// </summary>
        /// <param name="OperID"></param>
        /// <param name="Data">Order_Organization实体</param>
        /// <param name="tag"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string SetOrganization(int OperID, string Data, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Organization_TBLL.SetOrganization(OperID, Data, tag, YZM, RETID);
        }
        /// <summary>
        /// 获取企业列表
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrgListForm(int pageIndex, int pageSize, Dictionary<string, string> Dic, string YZM, int RETID)
        {
            return bl.IOrder_Organization_TBLL.GetOrgListForm(pageIndex, pageSize, Dic, YZM, RETID);
        }
        #endregion

        #region Order_OrganizationCheckOut_T

        /// <summary>
        /// 结帐统计
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="MerID"></param>
        /// <param name="OrgID"></param>
        /// <param name="Time"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string CountCheckOut(int pageIndex, int pageSize, string MerID, int OrgID, string Time, string YZM, int RETID)
        {

            return bl.IOrder_OrganizationCheckOut_TBLL.CountCheckOut(pageIndex, pageSize, MerID, OrgID, Time, YZM, RETID);
        }

        /// <summary>
        /// 结帐
        /// </summary>
        /// <param name="MerID"></param>
        /// <param name="OrgID"></param>
        /// <param name="Time">日期yyyyMMdd</param>
        /// <param name="Paid">实际给的钱</param>
        /// <param name="OperID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string CheckOut(string MerID, int OrgID, string Time, string Paid, int OperID, string YZM, int RETID)
        {
            return bl.IOrder_OrganizationCheckOut_TBLL.CheckOut(MerID, OrgID, Time, Paid, OperID, YZM, RETID);
        }
        #endregion

        #endregion

        #region Order_OrganizationForm_T

        /// <summary>
        /// 下企业订单
        /// </summary>
        /// <param name="Data"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string OrgBookOrder(string Data, string YZM, int RETID)
        {
            return bl.IOrder_OrganizationForm_TBLL.OrgBookOrder(Data, YZM, RETID);
        }
        /// <summary>
        /// 企业计算价格
        /// </summary>
        /// <param name="DishIDs"></param>
        /// <param name="DistCount"></param>
        /// <param name="MerID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string OrgCountDiscount(string[] DishIDs, int[] DistCount, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_OrganizationForm_TBLL.OrgCountDiscount(DishIDs, DistCount, MerID, YZM, RETID);
        }
        /// <summary>
        /// 根据企业获取订单
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="OrgID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrderFormOrgID(int pageIndex, int pageSize, int OrgID, string YZM, int RETID)
        {
            return bl.IOrder_OrganizationForm_TBLL.GetOrderFormOrgID(pageIndex, pageSize, OrgID, YZM, RETID);
        }
        /// <summary>
        /// 根据商户获取订单
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="OrgID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetOrderFormMerID(int pageIndex, int pageSize, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_OrganizationForm_TBLL.GetOrderFormMerID(pageIndex, pageSize, MerID, YZM, RETID);
        }
        #endregion


        #region  管理派送员信息接口
        public string SetOrder_Taker(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Taker_TBLL.SetOrder_Taker(json, tag, YZM, RETID);
        }
        #endregion

        #region 根据调度员获取旗下派送员信息


        public string GetOrder_Taker(string OperID, int tag, int pageIndex, int pageSize, string YZM, int RETID)
        {
            return bl.IOrder_Taker_TBLL.GetOrder_Taker(OperID, tag, pageIndex, pageSize, YZM, RETID);
        }
        #endregion

        #region 根据登陆的操作员获取所属的调度单

        public string GetOrder_SendByOperId(int OperID, string ConID, string StartTime, string EndTime, string FormID, int pageIndex, int pageSize, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetOrder_SendByOperId(OperID, ConID, StartTime, EndTime, FormID, pageIndex, pageSize, YZM, RETID);
        }
        #endregion

        #region 修改订单派送人员
        public string SetFormToTaker(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.SetFormToTaker(json, tag, YZM, RETID);
        }
        #endregion

        #region 统计列表
        public string GetOrder_SendList(string OperID, string OpenID, int pageIndex, int pageSize, string StarTime, string EndTime, int ConID, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetOrder_SendList(OperID, OpenID, pageIndex, pageSize, StarTime, EndTime, ConID, YZM, RETID);
        }
        #endregion

        #region 属于派送员（正在派送和未接单）的单子
        public string GetOrder_SendTaker(string TakerOpenID, int pageIndex, int pageSize, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetOrder_SendTaker(TakerOpenID, pageIndex, pageSize, YZM, RETID);
        }
        #endregion

        #region 查询派送员的归属的所有调度员
        public string GetTakerOfOper(string OpenID, string YZM, int RETID)
        {
            return bl.IOrder_Taker_TBLL.GetTakerOfOper(OpenID, YZM, RETID);
        }
        #endregion

        #region 当前派送单状态的下一个派送单状态
        public string GetNextCon(string FormID, string ConID, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetNextCon(FormID, ConID, YZM, RETID);
        }
        #endregion

        #region 获取订单控制
        public string GetCon(string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetCon(YZM, RETID);
        }
        #endregion

        #region 查询派送单
        public string SearchSend(int OperID, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.SearchSend(OperID, YZM, RETID);
        }
        #endregion

        #region 根据该商户id下所有派送员派送的订单
        public string GetGrid_Wiew_Send(int pageIndex, int pageSize, string Merid, string TakerName, string FormID, string Stime, string Etime, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetGrid_Wiew_Send(pageIndex, pageSize, Merid, TakerName, FormID, Stime, Etime, YZM, RETID);
        }
        #endregion

        #region 根据该id下对应派送员派送的订单
        public string GetGrid_Wiew(string FormID, string YZM, int RETID)
        {
            return bl.IOrder_Send_TBLL.GetGrid_Wiew(FormID, YZM, RETID);
        }
        #endregion

        #region Order_OrganinztionCheckOutFlow_T
        public string FlatOrgFlow(string Data, int OperID, string YZM, int RETID)
        {
            return bl.IOrder_OrganinztionCheckOutFlow_TBLL.FlatOrgFlow(Data, OperID, YZM, RETID);
        }
        #endregion

        public string GetOrder_EvaByPara(int pageIndex, int pageSize, string FormID, string DishesNmae, string EvaStars, string MerID, string YZM, int RETID)
        {
            return bl.IOrder_Eva_TBLL.GetOrder_EvaByPara(pageIndex, pageSize, FormID, DishesNmae, EvaStars, MerID, YZM, RETID);
        }

        public string GetOrder_FlowMon(int pageIndex, int pageSize, string AccNum, string WaltID, string WaltFlowType, string StarTime, string EndTime, string YZM, int RETID)
        {
            return bl.IOrder_FlowMon_TBLL.GetOrder_FlowMon(pageIndex, pageSize, AccNum, WaltID, WaltFlowType, StarTime, EndTime, YZM, RETID);
        }



        public string GetOrder_FlowPayByPara(int pageIndex, int pageSize, string AccName, string AccCall, string AccNum, string PayFlowType, string PayID, string PayFlowTime, string EFlowTime, string YZM, int RETID)
        {
            return bl.IOrder_FlowPay_TBLL.GetOrder_FlowPayByPara(pageIndex, pageSize, AccName, AccCall, AccNum, PayFlowType, PayID, PayFlowTime, EFlowTime, YZM, RETID);
        }

        //变更订单状态及留言（派送员模式）
        public string UpForm_OpenIDSend(string OpenID, string FormID, string ConID, string WillTime, string LY, string YZM, int RETID)
        {
            return bl.IOrder_Form_TBLL.UpForm_OpenIDSend(OpenID, FormID, ConID, WillTime, LY, YZM, RETID);
        }

        //得到当前订单所有的状态
        public string GetOrder_FormLog(int FormID, string YZM, int RETID)
        {
            return bl.IOrder_FormControl_TBLL.GetOrder_FormLog(FormID, YZM, RETID);
        }


        #region Order_MerSendAdd_T
        /// <summary>
        /// 获取所有送餐地址
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetAllMerSendAdd(int pageIndex, int pageSize, string YZM, int RETID)
        {
            return bl.IOrder_MerSendAdd_TBLL.GetAllMerSendAdd(pageIndex, pageSize, YZM, RETID);
        }
        /// <summary>
        /// 设置一个送餐地址
        /// </summary>
        /// <param name="json"></param>
        /// <param name="tag"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string SetOrder_MerSendAdd(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_MerSendAdd_TBLL.SetOrder_MerSendAdd(json, tag, YZM, RETID);
        }

        public string GetMerAddFromId(int pageIndex, int pageSize, int AddId, string YZM, int RETID)
        {
            return bl.IOrder_MerSendAdd_TBLL.GetMerAddFromId(pageIndex, pageSize, AddId, YZM, RETID);
        }
        #endregion

        #region Order_MerSend_T
        /// <summary>
        /// 获取这个商户下所有送餐地址
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="MerId"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetSendAddFromMerId(int pageIndex, int pageSize, string MerId, string YZM, int RETID)
        {
            return bl.IOrder_MerSend_TBLL.GetSendAddFromMerId(pageIndex, pageSize, MerId, YZM, RETID);
        }
        /// <summary>
        /// 设置这个商户下的地址
        /// </summary>
        /// <param name="MerId"></param>
        /// <param name="AddIds">以,分开</param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string UpdateMerSendAdd(string MerId, string AddIds, string YZM, int RETID)
        {
            return bl.IOrder_MerSend_TBLL.UpdateMerSendAdd(MerId, AddIds, YZM, RETID);
        }
        /// <summary>
        /// 根据商户获取此用户能用的送货地址
        /// </summary>
        /// <param name="MerId"></param>
        /// <param name="AccID"></param>
        /// <param name="YZM"></param>
        /// <param name="RETID"></param>
        /// <returns></returns>
        public string GetUserContactByMerid(string MerId, int AccID, string YZM, int RETID)
        {
            return bl.IOrder_MerSend_TBLL.GetUserContactByMerid(MerId, AccID, YZM, RETID);
        }
        #endregion

        #region 获取热门商品
        public string Get_Dishes_sort(string YZM, int RETID)
        {
            return bl.IView_Order_DishesBLL.Get_Dishes_sort(YZM, RETID);
        }
        #endregion

        #region 获取商户每月销量
        public string SalesCount(string YZM, int RETID)
        {
            return bl.IView_Order_FormBLL.SalesCount(YZM, RETID);
        }
        #endregion

        public string get_count(string YZM, int RETID)
        {
            return bl.IView_Order_FormBLL.get_count(YZM, RETID);
        }

        public string DCUserLogin_WeiXin(string AccMobile, string YZM, int RETID)
        {
            return bl.IView_UserBLL.DCUserLogin_WeiXin(AccMobile, YZM, RETID);
        }

        #region Order_UserSendAddr
        public string GetUserSendAddr(string OpenId, string MerId, string YZM, int RETID)
        {
            return bl.IOrder_UserSendAddrBLL.GetUserSendAddr(OpenId, MerId, YZM, RETID);
        }

        public string GetAllUserSendAddr(string OpenId, int AccID, string YZM, int RETID)
        {
            return bl.IOrder_UserSendAddrBLL.GetAllUserSendAddr(OpenId, AccID, YZM, RETID);
        }

        public string SetUserSendAddr(string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_UserSendAddrBLL.SetUserSendAddr(json, tag, YZM, RETID);
        }
        
        public string GetAllAddByUser(string YZM, int RETID)
        {
            return bl.IOrder_MerSendAdd_TBLL.GetAllAddByUser(YZM, RETID);
        }

        public string Get_DishesType(string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.Get_DishesType(YZM, RETID);
        }

        public string Get_Order_DishesType()
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesType();
        }

        public string Get_Order_DishesType_PC(string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesType_PC(YZM, RETID);
        }

        public string Get_Order_DishesType_PC_T(string DishesTypeID, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesType_PC_T(DishesTypeID, YZM, RETID);
        }

        public string Get_Order_DishesTypeByDishesTypeID(string DishesTypeID, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesTypeByDishesTypeID(DishesTypeID, YZM, RETID);
        }

        public string Get_Order_DishesTypeByPantID(string PantID, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesTypeByPantID(PantID, YZM, RETID);
        }

        public string UpdateDishesTypePhoto(string DishesTypeID, string DishesTypeURL, string YZM, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.UpdateDishesTypePhoto(DishesTypeID, DishesTypeURL, YZM, RETID);
        }

        public bool Get_Order_DishesTypeByName(string dishestypename)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesTypeByName(dishestypename);
        }

        public bool Get_Order_DishesTypeByName2(string dishestypename)
        {
            return bl.IOrder_DishesType_TBLL.Get_Order_DishesTypeByName2(dishestypename);
        }

        public string UpdateDishesTypePostion(string dishestypeidup, string dishestypeiddown, int postionup, int postiondown)
        {
            return bl.IOrder_DishesType_TBLL.UpdateDishesTypePostion(dishestypeidup, dishestypeiddown, postionup, postiondown);
        }

        public string UpdateDishesTypeSort(int OperID, string DishesTypeID, int Postion, int RETID)
        {
            return bl.IOrder_DishesType_TBLL.UpdateDishesTypeSort(OperID, DishesTypeID, Postion, RETID);
        }

        #endregion

        #region 图片上传信息
        public string Carousel_UploadPic(int OperID, string json, string YZM, int RETID)
        {
            return bl.IOrder_Carousel_TBLL.Carousel_UploadPic(OperID, json, YZM, RETID);
        }

        public string GetOrder_DishesCarousel_Photo(string DishesID, string YZM, int RETID)
        {
            return bl.IOrder_Carousel_TBLL.GetOrder_DishesCarousel_Photo(DishesID, YZM, RETID);
        }

        public string DishesCarousel_Photo_Del(int OperID, string json, int RETID)
        {
            return bl.IOrder_Carousel_TBLL.DishesCarousel_Photo_Del(OperID, json, RETID);
        }

        public string GetOrder_DishesCarousel(string YZM, int RETID)
        {
            return bl.IOrder_Carousel_TBLL.GetOrder_DishesCarousel(YZM, RETID);
        }

        public string ParameterOverview_UploadPic(int OperID, string json, string YZM, int RETID)
        {
            return bl.IOrder_ParameterOverview_TBLL.ParameterOverview_UploadPic(OperID, json, YZM, RETID);
        }

        public string GetOrder_DishesParameterOverview_Photo(string DishesID, string YZM, int RETID)
        {
            return bl.IOrder_ParameterOverview_TBLL.GetOrder_DishesParameterOverview_Photo(DishesID, YZM, RETID);
        }

        public string DishesParameterOverview_Photo_Del(int OperID, string ParameterOverviewID, int RETID)
        {
            return bl.IOrder_ParameterOverview_TBLL.DishesParameterOverview_Photo_Del(OperID, ParameterOverviewID, RETID);
        }

        #endregion

        #region 购物车    
        public string Order_ShoppingCar_Add(int OperID, string DisheID, string YZM, int RETID)
        {
            return bl.IOrder_ShoppingCar_TBLL.Order_ShoppingCar_Add(OperID, DisheID, YZM, RETID);
        }

        public string Order_ShoppingCar_Update(string CarID, int Num, string YZM, int RETID)
        {
            return bl.IOrder_ShoppingCar_TBLL.Order_ShoppingCar_Update(CarID, Num, YZM, RETID);
        }

        public string Order_ShoppingCar_Del(string CarID, string YZM, int RETID)
        {
            return bl.IOrder_ShoppingCar_TBLL.Order_ShoppingCar_Del(CarID, YZM, RETID);
        }

        public string Get_Order_Dishes_ShoppingCar(int OperID, string YZM, int RETID)
        {
            return bl.IOrder_ShoppingCar_TBLL.Get_Order_Dishes_ShoppingCar(OperID, YZM, RETID);
        }
        #endregion

        #region 商城信息
        public string Get_Order_Information(string YZM, int RETID)
        {
            return bl.IOrder_Information_TBLL.Get_Order_Information(YZM, RETID);
        }

        public string SetOrder_information(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IOrder_Information_TBLL.SetOrder_information(OperID, json, tag, YZM, RETID);
        }

        public string Get_Order_InformationByType(string Type, string YZM, int RETID)
        {
            return bl.IOrder_Information_TBLL.Get_Order_InformationByType(Type, YZM, RETID);
        }

        public string Details_Order_Information(string InformationID, string YZM, int RETID)
        {
            return bl.IOrder_Information_TBLL.Details_Order_Information(InformationID, YZM, RETID);
        }
        #endregion

        #region 用户区域地址
        public string Get_User_Districts()
        {
            return bl.IUser_District_TBLL.Get_User_Districts();
        }

        public string SetUser_District(int OperID, string json, int tag, string YZM, int RETID)
        {
            return bl.IUser_District_TBLL.SetUser_District(OperID, json, tag, YZM, RETID);
        }

        public string Get_User_DistrictsByDistrictID(string DistrictID, string YZM, int RETID)
        {
            return bl.IUser_District_TBLL.Get_User_DistrictsByDistrictID(DistrictID, YZM, RETID);
        }

        public string Get_User_DistrictsTwoByDistrictID(string DistrictID)
        {
            return bl.IUser_District_TBLL.Get_User_DistrictsTwoByDistrictID(DistrictID);
        }

        public string Get_User_DistrictsThreeByDistrictID(string DistrictID)
        {
            return bl.IUser_District_TBLL.Get_User_DistrictsThreeByDistrictID(DistrictID);
        }

        #endregion
    }
}
